package STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Views;

import java.awt.Color;
import java.awt.EventQueue;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;

public class App extends JFrame {

	/**
	 * Launch the application.
	 */

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					App frame = new App();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public App() {
		getContentPane().setBackground(Color.BLACK);
		setTitle("Quan ly nhan su");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 382, 170);
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		JMenu mnNhanvien = new JMenu("Nhan vien");
		menuBar.add(mnNhanvien);

		JMenu mnQuanLiNhan = new JMenu("Quan li nhan vien");
		mnQuanLiNhan.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				ViewNhanvien viewsNhanvien = new ViewNhanvien();
				viewsNhanvien.show();
			}
		});
		mnNhanvien.add(mnQuanLiNhan);

		JMenu mnChamCong = new JMenu("Cham cong");
		mnChamCong.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				new ViewChamcong().show();
			}
		});
		mnNhanvien.add(mnChamCong);

		JMenu mnThongKeThu = new JMenu("Thong ke thu nhap");
		mnNhanvien.add(mnThongKeThu);

		JMenu mnPhongBan = new JMenu("Phong ban");
		menuBar.add(mnPhongBan);

		JMenu mnQuanLiPhong = new JMenu("Quan li phong ban");
		mnQuanLiPhong.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new ViewPhongban().show();
			}
		});
		mnPhongBan.add(mnQuanLiPhong);
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout
				.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGap(0, 366, Short.MAX_VALUE));
		groupLayout
				.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGap(0, 110, Short.MAX_VALUE));
		getContentPane().setLayout(groupLayout);

	}
}
